package Dome1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DickYang
 * Date: 2023-05-08
 * Time: 8:34
 */
//交换两个数
class MyValue {
        public int value;
}
public class TestDome1 {
    public static void swap(MyValue myV1,MyValue myV2) {
        int tmp = myV1.value;
        myV1.value = myV2.value;
        myV2.value = tmp;
    }
    public static void main(String[] args) {
        MyValue myValue1 = new MyValue();
        myValue1.value = 10;
        MyValue myValue2 = new MyValue();
        myValue2.value = 20;

        swap(myValue1,myValue2);

        System.out.println(myValue1.value);
        System.out.println(myValue2.value);
    }
}
